package com.twu.biblioteca.menu;

import com.twu.biblioteca.*;

public abstract class CheckOutLibraryItemMenuItem extends CheckInOutMenuItem {
    protected CheckOutLibraryItemMenuItem(LibraryItemFinder itemFinder) {
        super(itemFinder);
    }

    @Override
    protected boolean performOperation(LibraryItem selectedItem, Library library, User currentUser) {
        return library.checkOutItem(selectedItem, currentUser);
    }

    @Override
    protected String getFailureMessage() {
        return "That " + getNoun() + " is not available.";
    }

    @Override
    protected String getSuccessMessage() {
        return "Thank you! Enjoy the " + getNoun() + "!";
    }

    @Override
    protected String getPromptMessage() {
        return "Which " + getNoun() + " would you like to check out? ";
    }

    protected abstract String getNoun();
}
